﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ArriviSoft.SlotMachine.Model
{
    public class SlotGenerator : ISlotGenerator
    {
        private Random rand;

        public SlotGenerator(int slots, int figures)
        {
            this.Slots = slots;
            this.Figures = figures;
            this.rand = new Random(DateTime.Now.Millisecond);   
        }

        public int Slots
        {
            get;
            private set;
        }

        public int Figures
        {
            get;
            private set;
        }

        #region ISlotGenerator Members

        public int[] Generate()
        {
            List<int> list = new List<int>(this.Slots);

            for (int i = 0; i < this.Slots; i++)
            {
                list.Add(rand.Next(this.Figures+1));
            }

            return list.ToArray();
        }

        #endregion
    }
}
